{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import sklearn.svm\n",
    "import sklearn.linear_model\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "import split\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_ids, val_ids, test_ids, train_labels, val_labels, test_labels = split.two_balanced_classes()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## SVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "color = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "l_list = [5, 6, 8, 10, 13, 16]\n",
    "errors = np.zeros(len(l_list))\n",
    "for i, l in enumerate(l_list):\n",
    "    train_data, val_data, test_data = split.load_images(train_ids, val_ids, test_ids, l, color)\n",
    "    train_data = train_data.reshape(len(train_ids), l*l*3)\n",
    "    val_data = val_data.reshape(len(val_ids), l*l*3)\n",
    "    test_data = test_data.reshape(len(test_ids), l*l*3)\n",
    "    model = sklearn.svm.LinearSVC(penalty='l2', C=1e10, dual=False)\n",
    "    model.fit(train_data, train_labels)\n",
    "    predictions = model.predict(val_data)\n",
    "    err = (predictions != val_labels).sum() / len(val_labels)\n",
    "    \n",
    "    errors[i] = err"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x7f6cd37969e8>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEWCAYAAACXGLsWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALE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sqaSjCZ6CPqWik5nZ7yuJZZmZDZH0Z4Ju7I8BMoBc4G8ESeZsM9smqQMw\nDXhZ0hEE/TkNBhrvb3xm9nQFsV5fSayunvFk4VLFjyWNCae7EnQclxPHfqcAh0jaN1BTK4KSQ+zg\nOMcB/zCzXcAuSVMhGPWQoJfPf8R08Hkg/1NTwt9zgYZmtgPYIalUUgbBt/y7wnaEUqCbgtHejgH+\nFY5lsEfSywmKz9Vj/sZxSU/SKIIP9CPMbFdYVRTvkK4CrjOzt6tzamCDmR1WjX3Lsyf8XRozvW++\nIcHIg60IOsArlrSayq+zpuNz9Zi3WbhU0ArYFCaKgcD+DPzyOnDdvgZwSf0lNS2zzfvAOZKaSGpJ\nUOVDWM21VtI54b4NJA050IupRCuCKrNiSScDXcLl04AxkhpLagGcFlF8LoV5snCp4N9AM0kLgN8C\nH1exfawJwGJgdthj50OUKXGH4wO8CMwJz/VJzOoLgGsk5QLzCRNJgjwBHCVpbnjexWF8HwGvEVRf\nvRL+3hpBfC6Fea+zzqUASRlmVqhgmN4PCRr850Qdl0sd3mbhXGr4u4JBtZoAj3iicDXNSxbOOeeq\n5G0WzjnnquTJwjnnXJU8WTjnnKuSJwvnnHNV8mThnHOuSv8fE9tR0oJrPAwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6cd37eba58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(l_list, errors)\n",
    "plt.title(\"Taux d'erreur en fonction de la taille\")\n",
    "plt.xlabel(\"Taille de l'image 'l'\")\n",
    "plt.ylabel(\"Taux d'erreur\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(6, 0.19900000000000001)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i_opt = np.argmin(errors)\n",
    "l_opt = l_list[i_opt]\n",
    "train_data, val_data, test_data = split.load_images(train_ids, val_ids, test_ids, l_opt, color)\n",
    "train_data = train_data.reshape(len(train_ids), l_opt*l_opt*3)\n",
    "val_data = val_data.reshape(len(val_ids), l_opt*l_opt*3)\n",
    "test_data = test_data.reshape(len(test_ids), l_opt*l_opt*3)\n",
    "model = sklearn.svm.LinearSVC(penalty='l2', C=1e10, dual=False)\n",
    "model.fit(train_data, train_labels)\n",
    "predictions = model.predict(test_data)\n",
    "err = (predictions != test_labels).sum() / len(test_labels)\n",
    "l_opt, err"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Logistic regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "color = False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "l_list = [5, 6, 8, 10, 13, 16]\n",
    "errors = np.zeros(len(l_list))\n",
    "for i, l in enumerate(l_list):\n",
    "    train_data, val_data, test_data = split.load_images(train_ids, val_ids, test_ids, l, color)\n",
    "    train_data = train_data.reshape(len(train_ids), l*l)\n",
    "    val_data = val_data.reshape(len(val_ids), l*l)\n",
    "    test_data = test_data.reshape(len(test_ids), l*l)\n",
    "    model = sklearn.linear_model.LogisticRegression(penalty='l2', C=1e10)\n",
    "    model.fit(train_data, train_labels)\n",
    "    predictions = model.predict(val_data)\n",
    "    err = (predictions != val_labels).sum() / len(val_labels)\n",
    "    \n",
    "    errors[i] = err"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x7f6cd36eb908>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEWCAYAAABMoxE0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1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Y0lKruw+l7g4j8EjiqqjWOcqqqF7v7h9z/gKrO9DoGY+rCnkhMkyYib4rISncu\nhut91ufWNK+G+6TyexH53J2H4/pq9rtfRDaLyH+B/j7r+7tPPStF5CO3V3FNjgAn3GOfF5HpPnHO\nEZE1IrJCREaJyGIR2SoiN7j7tBOR90VklRvrJT5x/EpENonIMhF5yeepwp/4jgNHq1h/ECit5X5M\nMxJyn8aMCbDvqOp+d3C+DBGZr6oH/DjuRqBQVceISEtguYgsVtUv5qsQkTHAZTjzx0QDmTg9i8Hp\nuX+9qm4VkXNweoenV3cxVX2ohli2q+pwEfkjzlQD5wJtgDXAX3AS0HRVPSwiXYCPgbdEZCzO+FjD\ngJZ1jU9V/11NrLfUEKtphiyRmKbuDhGZ6r5OxhmkL8OP49KBwSJyegKu9jhPHL4TH50HzFfVE8AJ\nEXkTnNkucUZbne8z0GpD/tcWuN+zgChVPQYcE5EKEWmD83TwoFtvUQF0F2eWv3OB1925KEpE5K0g\nxWeaOfvjMU2WiEzAebMfq6on3OInf6f4FeBmVV1Sn0sDxao6oh7HVqXE/V7h8/r0chTObJPtcQYb\nLBORXGq+z0DHZ5o5qyMxTVl7YL+bRFKBukzq8y5w8+nKeBEZKCKtKu3zEXCpiMSISDucYiTcorN8\nEbnUPTZCRIY39GZq0B6nGK5MRCYC3dz1HwNTRaSliLQFpngUn2niLJGYpuxtIFZEsoEHgM9q2d/X\n08AWINMdOfVJKj3Bu/M7vAasda/1uc/mq4CbRGQNsB43yQTJv4CzRSTLve4WN75PgXdwisQWut8P\neRCfaeJs9F9jmjARaaOqR8WZuvm/OI0P1nodl2larI7EmKbtb+JMmBYD/N2SiAkGeyIxxhjTIFZH\nYowxpkEskRhjjGkQSyTGGGMaxBKJMcaYBrFEYowxpkH+HwWrSlGhWkVoAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6cd36e9f60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(l_list, errors)\n",
    "plt.title(\"Taux d'erreur en fonction de la taille\")\n",
    "plt.xlabel(\"Taille de l'image 'l'\")\n",
    "plt.ylabel(\"Taux d'erreur\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(6, 0.19)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i_opt = np.argmin(errors)\n",
    "l_opt = l_list[i_opt]\n",
    "train_data, val_data, test_data = split.load_images(train_ids, val_ids, test_ids, l_opt, color)\n",
    "train_data = train_data.reshape(len(train_ids), l_opt*l_opt)\n",
    "val_data = val_data.reshape(len(val_ids), l_opt*l_opt)\n",
    "test_data = test_data.reshape(len(test_ids), l_opt*l_opt)\n",
    "model = sklearn.linear_model.LogisticRegression(penalty='l2', C=1e10)\n",
    "model.fit(train_data, train_labels)\n",
    "predictions = model.predict(test_data)\n",
    "err = (predictions != test_labels).sum() / len(test_labels)\n",
    "l_opt, err"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
